import { Switch, Space } from '../../components';

export default function SwitchView() {
  const onChange = (checked: boolean) => {
    console.log(`change: switch to ${checked}`);
  };

  const onClick = (checked: boolean) => {
    console.log(`click: switch to ${checked}`);
  };

  return (
    <Space>
      <Switch defaultChecked onChange={onChange} onClick={onClick} />
      <Switch checkedChildren="开启" unCheckedChildren="关闭" defaultChecked />
      <Switch checkedChildren="1" unCheckedChildren="0" />
      <Switch disabled defaultChecked />
      <Switch loading defaultChecked />
      <Switch size="small" />
      <Switch size="middle" />
      <Switch size="large" />
    </Space>
  );
}
